var id = getQuery("id")
window.onload = function (){
    findById(id);
}
function findById(id){
    axios.get("/custom/order/findById",{
        params: {
            id
        }
    }).then(e=>{
        var info = e.data;
        $("id").innerHTML =info.id;
        $("account").innerHTML =info.name;
        $("address").innerHTML =info.address;
        $("phone").innerHTML =info.phone;
        $("createDate").innerHTML =info.createDate;
        $("sumPrice").innerHTML =info.sumPrice;
        $("status").innerHTML =info.status;

        var str ="";
        for (var i=0;i<info.detailList.length;i++){
            var obj = info.detailList[i];
            str+=`<tr>
<td>${obj.productBean.id}</td><td>${obj.productBean.name}</td><td>${obj.productBean.price}</td><td>${obj.num}</td>
</tr>`
        }
        $("detailsDiv").innerHTML =str;
    })
}
function returnOrder(){
    location.href="/custom/order.html";
}